From: Ian Jackson Date: Wed, 28 May 2014 16:06:02 +0000 (+0100) Subject: build system: Introduce nosharedlibs variable. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4657 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=70d597d0efb85459ee8f7c1498f22ee7ffd390dd;p=xen.git build system: Introduce nosharedlibs variable. Introduce a new build variable "nosharedlibs". In tools/libxc use it instead of $(stubdom). In tools/xenstore honour it, and build static clients. If shared libs are disabled, do not try to install or symlink them. Set nosharedlibs when building for MiniOS or NetBSDRump. Signed-off-by: Ian Jackson Acked-by: Ian Campbell --- v2: Clarify deliberate INSTALL_SHLIB and SYMLINK_SHLIB breakage. --- diff --git a/config/MiniOS.mk b/config/MiniOS.mk index fc02b70fc4..32260ada91 100644 --- a/config/MiniOS.mk +++ b/config/MiniOS.mk @@ -7,3 +7,4 @@ LDFLAGS += $(DEF_LDFLAGS) $(ARCH_LDFLAGS) # Override settings for this OS PTHREAD_LIBS = +nosharedlibs=y diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk index e32c1cd7bc..8daade8eb3 100644 --- a/config/NetBSDRump.mk +++ b/config/NetBSDRump.mk @@ -8,3 +8,4 @@ XEN_LOCK_DIR = /var/lib WGET = ftp XENSTORE_XENSTORED=n +nosharedlibs=y diff --git a/tools/Rules.mk b/tools/Rules.mk index 327d2b4a41..9ac8541475 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -21,9 +21,18 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE) XENSTORE_XENSTORED ?= y +ifneq ($(nosharedlibs),y) INSTALL_SHLIB = $(INSTALL_PROG) SYMLINK_SHLIB = ln -sf libextension = .so +else +libextension = .a +XENSTORE_STATIC_CLIENTS=y +# If something tries to use these it is a mistake. Provide references +# to nonexistent programs to produce a sane error message. +INSTALL_SHLIB = : install-shlib-unsupported-fail +SYMLINK_SHLIB = : symlink-shlib-unsupported-fail +endif CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude) LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension) diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 4020f3787c..22eef8e3b6 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -109,16 +109,16 @@ $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \ $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS) : CFLAGS += -include $(XEN_ROOT)/tools/config.h LIB := libxenctrl.a -ifneq ($(stubdom),y) +ifneq ($(nosharedlibs),y) LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR) endif LIB += libxenguest.a -ifneq ($(stubdom),y) +ifneq ($(nosharedlibs),y) LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR) endif -ifneq ($(stubdom),y) +ifneq ($(nosharedlibs),y) LIB += xenctrl_osdep_ENOSYS.so endif diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 0cf06f1872..48b4e3dc87 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -28,7 +28,10 @@ LIBXENSTORE := libxenstore.a xenstore xenstore-control: CFLAGS += -static endif -ALL_TARGETS = libxenstore.so libxenstore.a clients +ALL_TARGETS = libxenstore.a clients +ifneq ($(nosharedlibs),y) +ALL_TARGETS += libxenstore.so +endif ifeq ($(XENSTORE_XENSTORED),y) ALL_TARGETS += xs_tdb_dump xenstored endif